Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Attribute Sets

Labels

ASCII
AttributeSet
Binary
attr (= 0x61747472 )

Data Format

No data.

Data Size

0

Description

An attribute set is a collection of attributes to be applied to an object, a facet of an object, or a vertex of an object. An attribute set may include attribute objects of as many types as desired, but may include only one attribute object of any particular type. Thus, an attribute set may contain both a diffuse color attribute and a specular color attribute, but may not contain two diffuse color attributes.

Though any attribute object may be included in any attribute set, some attributes cannot sensibly be applied to objects of certain types. For example, a normal cannot sensibly be applied to an entire view, as encapsulated in a view hints object. An application should disregard such attribute specifications.

Attributes may be assigned to other objects only indirectly, through the use of attribute sets. Attributes are included in an attribute set by placing the attribute objects and the attribute set object together in a container. The attributes in that set may be assigned to a geometric object by placing the relevant container and the geometric object together in a further container.

An attribute set may also be placed in a cap attribute set of any type; in this way, attributes may be assigned separately and selectively to the caps and face of a cone or cylinder. Attribute sets may also be placed in face, geometry, and vertex attribute set lists; in this way, attributes may be assigned separately and selectively to the facets, segments, and vertices of geometric objects having those features.

An attribute set may also be placed in a group. Unless overridden, the attributes in an attribute set placed in a hierarchically structured group are inherited by objects at lower levels in the hierarchy of that group. (An application should not permit an attribute to be inherited by an object to which that attribute cannot sensibly be applied.) See the sections on cap attribute sets, attribute set lists, and groups for complete details on the composition of these objects.

Parent Hierarchy

Shared, set.

Parent Objects

Any geometric object, cap attribute set, attribute set list, or group. An attribute set always has a parent object.

Child Objects

Attributes: ambient coefficient, diffuse color, specular color, specular control, transparency color, highlight state, shading UV, surface UV (all optional).

Example

Container (
    Polygon (...)           # all attributes in set applied to polygon
    Container (             # container puts attributes in set
        AttributeSet ( )    
        AmbientCoefficient (...)
        DiffuseColor (...)
        SpecularColor (...)
        SpecularControl (...)
        Normal (...)
    )
)

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |